package yesjava;

public class RunnableMyObject implements Runnable{
    private MyObject myObject;
    public RunnableMyObject(MyObject myObject) {
        this.myObject = myObject;
    }

    private boolean sw = true;

    public void run() {
        myObject.add();
    }

    public void close(){
        this.sw = false;
    }
}
